﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetExtensions.Core.IOC
{
    [AttributeUsage(AttributeTargets.Class)]
    public class InjectAttribute : Attribute
    {
        public InjectAttribute() { }
        public InjectAttribute(InjectScope scope)
        {
            Scope = scope;
        }
        public InjectAttribute(InjectScope scope, string named)
        {
            Scope = scope;
            Named = named;
        }
        public InjectAttribute(string named)
        {
            Scope = InjectScope.Instance;
            Named = named;
        }
        public InjectScope Scope { get; set; } = InjectScope.Instance;
        public string Named { get; set; }
    }

    [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class)]
    public class AutoInjectAttribute : Attribute
    {
        public AutoInjectAttribute() { }
        public AutoInjectAttribute(InjectKind kind)
        {
            Kind = kind;
        }
        public InjectKind Kind { get; set; } = InjectKind.Typed;
    }

    public enum InjectScope
    {
        Scoped = 0,
        Instance = 1,
        Single = 2
    }
}
